<%@tag pageEncoding="UTF-8" %>
<%@ attribute name="ram" type="java.lang.Long" %>
<%
    String s = "";
    if (ram < 1024L) {
        s = ram + "B";
    } else if (1024 <= ram && ram < (1024 * 1024L)) {
        s = ram / 1024 + "KB";
    } else if ((1024 * 1024L) <= ram && ram < (1024 * 1024 * 1024L)) {
        s = ram / 1024 / 1024 + "MB";
    } else if ((1024 * 1024 * 1024L) <= ram && ram < (1024 * 1024 * 1024 * 1024L)) {
        s = ram / 1024 / 1024 / 1024 + "GB";
    } else if ((1024 * 1024 * 1024 * 1024L) <= ram && ram < (1024 * 1024 * 1024 * 1024 * 1024L)) {
        s = ram / 1024 / 1024 / 1024 / 1024 + "TB";
    }
    out.print(s);
    out.flush();
%>
